package com.example.algorithms;

import com.example.algorithms.DynamicProgramming.FibonacciSequence;
import com.example.algorithms.recursion.Factorial;
import com.example.algorithms.recursion.FrogJumping;
import com.example.algorithms.sort.BucketSort;
import com.example.algorithms.sort.CountingSort;
import com.example.algorithms.sort.RadixSort;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.Arrays;

@SpringBootApplication
public class AlgorithmsApplication {

    public static void main(String[] args) {
        SpringApplication.run(AlgorithmsApplication.class, args);

        int[] arr={5,3,1,4,2};
        // arr = SelectionSort.sortDown(arr);

        // arr = InsertionSort.sortDownBySentinel(arr);

        // arr= MergeSort.sortDown(arr);
        // arr= QuickSort.sortUp(arr);
        // arr= HeapSort.sortUp(arr);
        // System.out.println(Arrays.toString(arr));
        //
        // TwoNumSum.find(4,arr);
        // TwoNumSum.findDuplicate(4,arr);
        //ThreeNumSum.findByDouPoints(8,arr);
        //int result = FibonacciSequence.byDynamicProgramming(5);
        //int result = Factorial.f(4);
        // int result = FrogJumping.f(4);
        // System.out.println(result);
        // BucketSort.sort(new int[]{22,5,11,41,45,26,29,10,7,8,30,27,42,43,40}, 5);
        // System.out.println(Arrays.toString(CountingSort.sort(arr)));
        System.out.println(Arrays.toString(RadixSort.sort(new int[]{170,45,75,90,802,24,2,66})));
    }

}
